<?php
define('ROOT_PATH','../');
define('TEMPLATE_DIR','gmer/');
require_once(ROOT_PATH.'code/bean/config.inc.php');
require_once(ROOT_PATH.'code/class/gmer/class.admin_user.php');
require_once(ROOT_PATH.'code/bean/smarty.config.inc.php');
require_once(ROOT_PATH.'code/bean/db_config.inc.php');
$user=new gmer_user();
$session=check_login('admin/index.php');

if($user->gm_level!='高级GM') js_alert('您不是高级gm无法调整',true);
if(isset($_POST['user']) && $_POST['user']!='') {
	$nick_name=$_POST['user'];
	$rp=floor($_POST['rp']);
	$sql="select RP from user_info where nick_name='$nick_name'";
	$res=sql_get_one($sql,__LINE__);
	if(!$res) js_alert('数据库中没有该用户',true);
	$rp=$res['RP']+$rp;
	$sql="update user_info set RP=$rp where nick_name='$nick_name'";
	sql_run($sql,__LINE__);
	js_alert('操作成功!',true);
}
$session=check_login('admin/index.php');
if($user->session) {
	$tpl->assign('user',$user);	
	$tpl->assign('file_gm_info','tpl/gm_user_info.tpl');
	$tpl->display('op_base_RP.html');
}else {
	$tpl->display('gm_login.html');
}
?>